FROM node:16.14.2-slim as builder1
WORKDIR /app/code
COPY package.json yarn.lock /app/code/
RUN yarn config set registry https://registry.npm.taobao.org/
RUN yarn install
COPY . /app/code
RUN yarn build

FROM nginx:latest
WORKDIR /app/code
COPY --from=builder1 /app/code/dist /usr/share/nginx/html/
COPY --from=builder1 /app/code/deploy/nginx/default.config /etc/nginx/cofifg.d/default.config
